package com.seeapp.backend.file;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WebExcelProcessor extends ExcelProcessor {
	private HttpServletRequest request;
	private HttpServletResponse response;

	public WebExcelProcessor(String excelFileShortName, HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		super(excelFileShortName, response.getOutputStream());
		this.request = request;
		this.response = response;
	}

	/**
	 * 设置文件下载名称
	 * 
	 * @param dowLoadFileName
	 * @throws Exception
	 */
	public WebExcelProcessor setDowLoadFileName(String dowLoadFileName) throws Exception {
		FileUtil.setDowLoadFileHttpHead(this.response);
		FileUtil.setDowLoadFileName(request, response, dowLoadFileName);
		return this;
	}

}
